home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / DOC.ZIP / PACKAGE.DOC < prev    next >
Text File  |  1992-11-09  |  37KB  |  861 lines

  1. ========================================================================
  2. ==        ME2 Packages             Craig Durland  10/91 ==
  3. ========================================================================
  4.  
  5. Here is some documentation on some of the packages of Mutt programs I
  6. use.
  7.  
  8.              Copyright 1991 Craig Durland
  9.     Distributed under the terms of the GNU General Public License.
  10.   Distributed "as is", without warranties of any kind, but comments,
  11.            suggestions and bug reports are welcome.
  12.  
  13. ========================================================================
  14. ==            Customizing me2.mut                  ==
  15. ========================================================================
  16.  
  17. Overview:
  18.   When ME2 runs, it tries to load several files:
  19.     osstuff.mco : OS related stuff.
  20.     ./mext.mco  : Directory local ME2 extensions
  21.     myme.mco    : Your personal ME2 extensions.
  22.   (You can change this behavior, see package me2.mut below).
  23.  
  24.  
  25. Package:    me2.mut
  26. How loaded: Compiled into ME2 (with the C compiler).
  27. Description:
  28.   This is (most of) the front end for ME2.  It sets up lots of
  29.     keybindings, autoloading, etc.  When ME2 runs, me2.mut tries to load
  30.     several files:
  31.       osstuff.mco : OS related stuff.
  32.       ./mext.mco  : Directory local ME2 extensions
  33.       myme.mco    : Your personal ME2 extensions.
  34.  
  35.   If you want to change basic ME2, edit this file, and recompile ME2.
  36.  
  37. Package:    myme.mut
  38. How loaded: By me2.mut as part of start up.
  39. Description:
  40.   This is the file that you put your personal extensions to ME2 in.
  41.     This is the stuff you don't want to everybody to have to use.  You
  42.     should put myme.mco in a spot that that is only in your ME2 path
  43.     (such as your home directory).
  44.   A copy of the file I use is in ../mutt/myme.mut.
  45. Functions you might to call:
  46.   command-line-done (bool it-has-been-processed)
  47.     Call this if you have processed the command line.
  48.  
  49. Package:  osstuff.mco
  50. See:  OS Stuff below.
  51.  
  52. Package:    ./mext.mut
  53. How loaded: By me2.mut as part of start up.
  54. Description:
  55.   If this file is the current directory when ME2 starts, me2.mut will
  56.     load it.  Use it to hold stuff you want ME2 to know about only in
  57.     this directory.
  58.   For example, I have a bunch of Mutt code to help me design bicycles.
  59.     I could autoload it but then I would have to type something
  60.     every time I wanted to work on a bicycle.  Since I do all the work in
  61.     the bicycle directory, I just put the code in bicycle/myme.mco and
  62.     when I run ME2, it is loaded automatically.
  63.  
  64. ========================================================================
  65. ==            Mark Rings                      ==
  66. ========================================================================
  67.  
  68. Package:    markring.mut
  69. How loaded: part of me2.mut, turned on for interactive buffers
  70. Description:
  71.   Mark rings provide a way to mark multiple places in a buffer so you
  72.   can jump to them easily.  Note that they can't span buffers.  Up to 4
  73.   marks (easily changeable in markring.mut) are kept, as more are set,
  74.   the ring wraps around and reuses the older marks.
  75. Functions:
  76.   markring-push        M-C-p or F-9
  77.     Push the dot into the end of the ring.
  78.   markring-pop        M-p
  79.     Goto the next mark in the ring.
  80.   markring-delete    Not bound
  81.     Remove the most recently popped mark from the ring.
  82.   markring-init        Not bound
  83.     Use this if a markring was not setup in this buffer (it normally is)
  84.     or you want to remove all marks from the ring and start over.
  85.  
  86. ========================================================================
  87. ==            Mode Support                      ==
  88. ========================================================================
  89.  
  90. Package:    alamode.mut
  91. How loaded: part of me2.mut
  92. Description:
  93.   This is the package that turns on modes.  Here is how it works (in the
  94.     order that things happen):
  95.   - When a interactive buffer is created, if the environment variable
  96.     MEMODE is set, "-mode" is appended to it and a call is made to that
  97.     function.  For example, if MEMODE is set to "mail", every time a
  98.     interactive buffer is created, "mail-mode" is called for that
  99.     buffer.  If the mode doesn't exist, ME2 will complain.
  100.   - If there is no MEMODE variable, the buffer name is looked at.  The
  101.     list of modes is looked at to see if any of the modes fits the name.
  102.     (You can change the list with auto-mode-list (see below).)  Here are
  103.     the default modes:
  104.       Extension        Program Run
  105.       ---------        -------    ---
  106.     .c        c-mode
  107.     .h        c-mode
  108.     .mut        mutt-mode
  109.     .doc        text-mode
  110.     .txt        text-mode
  111.     If the program is not there, ME2 will complain, but you might not
  112.       see it because other things will be written to the command line
  113.       after the error message (like "[Read 10 lines]").  No harm is done
  114.       if the mode is not run.
  115.     If there are no matches, the default-major-mode is run (see below).
  116.   - When a file is read into a interactive buffer, the first line of the
  117.     buffer is looked at.  If it contains text of the form "-*-foo-*-",
  118.     foo-mode is run.
  119. Functions:
  120.   default-major-mode    Not bound
  121.     Set the default major mode.  This is the mode set for a interactive
  122.       buffer when no other mode seems to fit.
  123.     For example:  If you want text mode to be the default:
  124.     (default-major-mode "text").  The "-mode" is appended when the mode
  125.       needs to be run.
  126.     The mode might be changed when the file is read in (see above).
  127.     The default is "none".
  128.   (auto-mode-list (bool append)(string mode-re mode-name ...)
  129.     Append or Prepend to the list of modes.
  130.     Input:
  131.       append:  TRUE if you want your list of modes to be appended (ie
  132.     searched last) to the list of modes.  There are two reasons you
  133.     might want to do this:  If you have not-very-often used mode,
  134.     putting it a the end of the list means a quicker search time for
  135.     the more often used modes.  If you want to override one of the
  136.     defaults, prepend so your new mode will be found first.
  137.       mode-re:
  138.         This is a regular expression that the buffer name is tested with.
  139.       If there is a match, mode-name is run.  For example, if you
  140.       want to test for the extension foo, use '.*\.foo$'.  The
  141.       single quote is important.  This re matches any string that
  142.       ends with the characters ".foo".  Note:  the re is not a
  143.       searching re - it is in place regular expression match.  That
  144.       is why you need the .* at the start.
  145.     Notes:
  146.       The mode-re is used to match the buffer name NOT the file
  147.         name.  Since I do the match at buffer create time, I don't
  148.         have a file name.  If you want to match file names, you will
  149.         need to change the call to set-mode from buffer-created-hook
  150.         to file-read-hook.  I used buffer-created-hook because then
  151.         I can use (switch-to-buffer) and have the mode set without
  152.         reading in a file.
  153.       My Unix mailer uses temp files named "/tmp/Re<digits>".  An re
  154.         to match that is 'Re[0-9]+$'.  Then, whenever mail uses ME
  155.         to edit mail, you can edit with your favorite mail mode.
  156.       mode-name:  The name of the mode you want to run if there is a
  157.         match.  If you want c mode, use "c".  The "-mode" is appended
  158.     when the mode needs to be run.
  159.     Here is the default:
  160.       (auto-mode-list TRUE
  161.     '.*\.c$'    "c"
  162.     '.*\.h$'    "c"
  163.     '.*\.mut$'    "mutt"
  164.     '.*\.doc$'    "text"
  165.     '.*\.txt$'    "text"
  166.       )
  167.     If you want to get rid of mode, prepend it and use none.  For
  168.       example, if you don't like c mode, use
  169.       (auto-mode-list FALSE '.*\.c$' "none"  '.*\.h$' "none") and c-mode
  170.       won't be called.  Of course, you could also just remove cmode.mco
  171.       and achieve the same result.
  172.     If you want to get rid of all modes, use 
  173.       (auto-mode-list FALSE '.' "none").  This will set every buffer to
  174.       none-mode.
  175. Notes:
  176.   While using the mode-re's gives a lot of flexibility, I wonder about
  177.     the speed hit.  Knowing how all this is implemented, it seems like
  178.     all those regular expression tests has got to take a long time.  It
  179.     doesn't seem to on my machine (but its a real fast machine).  Does
  180.     anyone use anything but the extension?  If not, i